<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>正方形照片墙</title>
    <style>
        .box{
            position: relative;
            float: left;
            width: 24%;
            padding-top: 24%;
            /*为了直观显示效果，加个边框*/
            border: 1px solid #000000;
        }
        .box img{
            position: absolute;
            top: 0;
            left:0;
            width: 100%;
        }
    </style>
</head>
<body>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>

    <!--重复图片测试-->
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
    <div class="box">
        <img src="./img.jpg" alt="">
    </div>
</body>
</html>